/*
 * ShoppingCartShopStatisticsHolder.java
 * business
 *
 * Created by SunDing on 2016/9/9.
 *
 * Copyright (c) 2016年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.widget.listview.viewholder;

import android.view.View;
import android.widget.TextView;

import com.yidiandao.business.R;
import com.yidiandao.business.data.bean.Shop;
import com.yidiandao.business.manager.ShoppingCartManager;
import com.yidiandao.business.ui.widget.listview.ViewHolder;
import com.yidiandao.business.utils.UIUtils;

/** 购物车-当前店铺统计Item ViewHolder */
public class ShoppingCartShopStatisticsHolder extends ViewHolder {

    private TextView mTvPrice;

    @Override
    protected void initView(View rootView) {
        mTvPrice = (TextView) rootView.findViewById(R.id.tv_price);
    }

    @Override
    protected int getItemLayoutId() {
        return R.layout.item_shopping_cart_shop_statistics;
    }

    public void refreshUI(Shop shop) {
        float totalPriceOfShop = ShoppingCartManager.getInstance().getTotalPriceOfShop(shop);
        mTvPrice.setText(UIUtils.getString(R.string.shopping_cart_page_value, totalPriceOfShop));
    }
}
